<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit application
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<% using (Html.BeginForm())
	{ %>
	<div class="pagetitle">
		<h1>
			Application settings</h1>
	</div>
	<div class="pagecontent">
		<%= Html.ValidationSummary("Creation was unsuccessful. Please correct the errors and try again.") %>
		<table class="columns">
			<tr>
				<td class="column half">
					<div class="innercolumn">
						<fieldset class="group">
							<legend>Basic settings</legend>
							<div class="groupcontent">
								<p>
									<label for="name">
										Application name:</label>
									<%= Html.TextBox("name", ViewData[ "name" ], new { style ="width:100%;" } )%>
									<%= Html.ValidationMessage("name") %>
								</p>
								<p>
									<label for="language">
										Language code</label>
									<%= Html.TextBox("language", ViewData["language"], new { style = "width:50px;" })%>
									<%= Html.ValidationMessage("language")%>
								</p>
							</div>
						</fieldset>
						<fieldset class="group">
							<legend>Default adresses</legend>
							<div class="groupcontent">
								<p>
									<label for="senderemail">
										Sender E-Mail</label>
									<%= Html.TextBox("senderemail", ViewData["senderemail"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("senderemail")%>
								</p>
								<p>
									<label for="sendername">
										Sender Name</label>
									<%= Html.TextBox("sendername", ViewData["sendername"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("sendername")%>
								</p>
								<p>
									<label for="recipientemail">
										Recipient E-Mail</label>
									<%= Html.TextBox("recipientemail", ViewData["recipientemail"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("recipientemail")%>
								</p>
								<p>
									<label for="recipientname">
										Recipient Name</label>
									<%= Html.TextBox("recipientname", ViewData["recipientname"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("recipientname")%>
								</p>
								<p>
									<label for="replytoemail">
										Reply-to E-Mail</label>
									<%= Html.TextBox("replytoemail", ViewData["replytoemail"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("replytoemail")%>
								</p>
							</div>
						</fieldset>
						<fieldset class="group">
							<legend>Tracking</legend>
							<div class="groupcontent">
								<p>
									<label>
										How to track sent mails?
										</label>
									<%= Html.RadioButton( "trackingmode", "none" ) %>
									No tracking
									<br />
									<%= Html.RadioButton("trackingmode", "mailbox")%>
									Use mailbox
									<br />
									<%= Html.RadioButton("trackingmode", "smtpserver")%>
									Use built in smtp-server<br />
								</p>
								<p>
									<label for="trackingmailpublicaddress">
										Bounce-address:</label>
									<%= Html.TextBox("trackingmailpublicaddress", ViewData["trackingmailpublicaddress"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("trackingmailpublicaddress")%>
								</p>
								<p>
									<label for="trackingmailserver">
										Mailserver</label>
									<%= Html.TextBox("trackingmailserver", ViewData["trackingmailserver"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("trackingmailserver")%>
								</p>
								<p>
									<label for="trackingmailusername">
										Mailbox username</label>
									<%= Html.TextBox("trackingmailusername", ViewData["trackingmailusername"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("trackingmailusername")%>
								</p>
								<p>
									<label for="trackingmailpassword">
										Mailbox password</label>
									<%= Html.TextBox("trackingmailpassword", ViewData["trackingmailpassword"], new { style = "width:100%;" })%>
									<%= Html.ValidationMessage("trackingmailpassword")%>
								</p>
							</div>
						</fieldset>
					</div>
				</td>
				<td class="column last half">
					<div class="innercolumn">
						<fieldset class="group">
							<legend>Integration info</legend>
							<div class="groupcontent">
								<p>
									<label for="name">
										Public API Key:</label>
									<input type="text" readonly="readonly" value="<%=ViewData["PublicID"] %>" style="width: 100%;" />
								</p>
								<p>
									<label for="name">
										API Secret:</label>
									<input type="text" readonly="readonly" value="<%=ViewData["Secret"] %>" style="width: 100%;" />
								</p>
							</div>
						</fieldset>
						<fieldset class="group">
							<legend>Public page styling</legend>
							<div class="groupcontent">
								<p>
									<label for="userstylesheet">
										Custom stylesheet:</label>
									<%= Html.TextArea("userstylesheet", new { style = "width:100%;height:100px;" })%>
								</p>
								<p>
									<label for="usertophtml">
										Custom HTML embedded before public pages:</label>
									<%= Html.TextArea("usertophtml", new { style = "width:100%;height:100px;" })%>
								</p>
								<p>
									<label for="usertophtml">
										Custom HTML embedded before public pages:</label>
									<%= Html.TextArea("userbottomhtml", new { style = "width:100%;height:100px;" })%>
								</p>
								<p>
									<label for="userheadhtml">
										Custom code embedded in public page headers:</label>
									<%= Html.TextArea("userheadhtml", new { style = "width:100%;height:100px;" })%>
								</p>
							</div>
						</fieldset>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div class="pageactions">
		<p>
		<input type="submit" class="button" value="Update application" />
		</p>
	</div>
	<% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
